﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace code
{
    class Words//本类用于将单词和汉字答案加入到list中以供方便按下标取出
    {
        List<string> words = new List<string>();
        List<string> answers = new List<string>();
        public List<string> GetWords()
        {
            TheSqlConnection theSqlConnection = new TheSqlConnection();
            MySqlDataReader dataReader = theSqlConnection.GetSqlDataReader();
            while (dataReader.Read())
            {
                words.Add((string)dataReader["words"]);
            }
            return words;
        }
        public List<string> GetAnswers()
        {
            TheSqlConnection theSqlConnection = new TheSqlConnection();
            MySqlDataReader dataReader = theSqlConnection.GetAnswer();
            while (dataReader.Read())
            {
                answers.Add((string)dataReader["answers"]);
            }
            return answers;
        }
    }
}
